<hornetq:binding.hornetq> <selector:operationSelector operationName="greet"/> (... snip ...) </hornetq:binding.hornetq>
OperationSelector provides a capability to determine which service operation should be invoked for the message exchange. The following options are available. If the target service only has a single operation, this setting is optional.
specify a operation name in the configuration.
<hornetq:binding.hornetq> <selector:operationSelector operationName="greet"/> (... snip ...) </hornetq:binding.hornetq>
specify a XPath location which contains a operation name to be invoked in the message contents.
If the configuration looks like this:
<jca:binding.jca> <selector:operationSelector.xpath expression="//person/language"/> (... snip ...) </jca:binding.jca>
And the message content is like this:
<person> <name>Fernando</name> <language>spanish</language> </person>
Then operation spanish() would be invoked.
specify a Regular Expression to find a operation name to be invoked in the message contents.
If the configuration looks like this:
<http:binding.http> <selector:operationSelector.regex expression="[a-zA-Z]*Operation"/> (... snip ...) </http:binding.http>
And the message content is like this:
xxx yyy zzz regexOperation aaa bbb ccc
Then operation regexOperation() would be invoked.
specify a Java class which is able to determine the operation to be invoked.
configuration should look like this:
<jca:binding.jca> <selector:operationSelector.java class="org.switchyard.example.MyOperationSelectorImpl"/> (... snip ...) </jca:binding.jca>
Note that the org.switchyard.example.MyOperationSelectorImpl needs to be a subclass of org.switchyard.component.common.selector.OperationSelector or other concrete OperationSelector classes for each service bindings. You can override the selectOperation() method as you like.
Default OperationSelector implementation for each service bindings are following:
Camel : org.switchyard.component.camel.selector.CamelOperationSelector
JCA/JMS : org.switchyard.component.jca.selector.JMSOperationSelector
JCA/CCI : org.switchyard.component.jca.selector.CCIOperationSelector
HTTP : org.switchyard.component.http.selector.HttpOperationSelector
Support for operation selector is limited to Camel, JCA and HTTP service bindings. Support for other service bindings will be added in the future.